import os

class FlexView:
    def __init__(self, 
                    title, 
                    flex_app_name,
                    settings_url=None,
                    secure_dir = None,
                    player_version='10.0.0', 
                    width=None, 
                    height=None 
                    ):
        self.title = title
        self.flex_app_name = flex_app_name
        self.player_version = player_version
        self.width = width or '100%'
        self.height = height or '100%'
        self.settings_url = settings_url or 'runtime/settings.xml'
        self.secure_dir = secure_dir
    
    def path(self):
        return os.path.join(os.path.dirname(__file__), 'views/flex.html')
    
    def template_values(self):
        return {
            'title' : self.title,
            'flex_app_name' : self.flex_app_name,
            'player_version' : self.player_version,
            'width' : self.width,
            'height' : self.height,
            'settings_url': self.settings_url,
            'secure_dir' : self.secure_dir,
            }